<!DOCTYPE html>
<html lang="zh-CN" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Homalos系统全局配置说明 | Homalos</title>
    <meta name="description" content="基于 Python 的量化交易系统">
    <meta name="generator" content="VitePress v1.6.3">
    <link rel="preload stylesheet" href="/assets/style.RmNjDeKb.css" as="style">
    <link rel="preload stylesheet" href="/vp-icons.css" as="style">
    <script type="module" src="/assets/chunks/metadata.28daeedd.js"></script>
    <script type="module" src="/assets/app.BvKZi2Jp.js"></script>
    <link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
    <link rel="modulepreload" href="/assets/chunks/framework.CXkkaYWf.js">
    <link rel="modulepreload" href="/assets/chunks/theme.C_3djJbO.js">
    <link rel="modulepreload" href="/assets/chunks/katex.ChWnQ-fc.js">
    <link rel="modulepreload" href="/assets/chunks/dagre-FFZHY6LT.v5YVXi2p.js">
    <link rel="modulepreload" href="/assets/chunks/c4Diagram-6F6E4RAY.nCOphmw6.js">
    <link rel="modulepreload" href="/assets/chunks/flowDiagram-PKI6S5ZS.CNud1oVM.js">
    <link rel="modulepreload" href="/assets/chunks/erDiagram-R3QVA2FD.DXgbj8um.js">
    <link rel="modulepreload" href="/assets/chunks/gitGraphDiagram-GW3U2K7C.BIFeTK-V.js">
    <link rel="modulepreload" href="/assets/chunks/ganttDiagram-EK5VF46D.DQ3Wppe5.js">
    <link rel="modulepreload" href="/assets/chunks/infoDiagram-XT3IWWJI.BaVwhgm7.js">
    <link rel="modulepreload" href="/assets/chunks/pieDiagram-NIOCPIFQ.DSbeskqj.js">
    <link rel="modulepreload" href="/assets/chunks/quadrantDiagram-2OG54O6I.DF4IDJMG.js">
    <link rel="modulepreload" href="/assets/chunks/xychartDiagram-H2YORKM3.CdWfFttn.js">
    <link rel="modulepreload" href="/assets/chunks/requirementDiagram-SO3GGRV7.DMU_G9xQ.js">
    <link rel="modulepreload" href="/assets/chunks/sequenceDiagram-ZIKVLSP4.kn4OakjH.js">
    <link rel="modulepreload" href="/assets/chunks/classDiagram-BGRH5UQR.DgQjJs6U.js">
    <link rel="modulepreload" href="/assets/chunks/classDiagram-v2-O24JOBDK.DgQjJs6U.js">
    <link rel="modulepreload" href="/assets/chunks/stateDiagram-XX37X6EN.CRy2e-oJ.js">
    <link rel="modulepreload" href="/assets/chunks/stateDiagram-v2-GD6S3NHB.BvRhId1O.js">
    <link rel="modulepreload" href="/assets/chunks/journeyDiagram-EWQZEKCU.BmQuVtJT.js">
    <link rel="modulepreload" href="/assets/chunks/timeline-definition-RI47OAVP.BxnQlAvf.js">
    <link rel="modulepreload" href="/assets/chunks/mindmap-definition-CZNETY7S.COCrfbvy.js">
    <link rel="modulepreload" href="/assets/chunks/kanban-definition-ILFWEQ3N.ChbXTd5M.js">
    <link rel="modulepreload" href="/assets/chunks/sankeyDiagram-4UZDY2LN.CpcNCvzD.js">
    <link rel="modulepreload" href="/assets/chunks/diagram-5UYTHUR4.J7RHmGCi.js">
    <link rel="modulepreload" href="/assets/chunks/diagram-ZTM2IBQH.BuJ-LU2f.js">
    <link rel="modulepreload" href="/assets/chunks/blockDiagram-PHRCVELO.DewF8s8X.js">
    <link rel="modulepreload" href="/assets/chunks/architectureDiagram-NQ2NVSRB.wzQlUmK0.js">
    <link rel="modulepreload" href="/assets/chunks/diagram-3EMPZRKU.1yGJgsvk.js">
    <link rel="modulepreload" href="/assets/chunks/virtual_mermaid-config.DDnGl6nM.js">
    <link rel="modulepreload" href="/assets/guide_config_system_config.md.C1R5Xu4Z.lean.js">
    <link rel="icon" type="image/png" sizes="32x32" href="/assets/newnewlogo.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/assets/newnewlogo.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/assets/newnewlogo.png">
    <link rel="mask-icon" href="/assets/newnewlogo.png" color="#5bbad5">
    <meta name="theme-color" content="#5f67ee">
    <script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
    <script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
  </head>
  <body>
    <div id="app"><div class="Layout" data-v-5d98c3a5><!--[--><!--[--><!--]--><!--]--><!--[--><span tabindex="-1" data-v-0b0ada53></span><a href="#VPContent" class="VPSkipLink visually-hidden" data-v-0b0ada53>Skip to content</a><!--]--><!----><header class="VPNav" data-v-5d98c3a5 data-v-ae24b3ad><div class="VPNavBar" data-v-ae24b3ad data-v-6aa21345><div class="wrapper" data-v-6aa21345><div class="container" data-v-6aa21345><div class="title" data-v-6aa21345><div class="VPNavBarTitle has-sidebar" data-v-6aa21345 data-v-1168a8e4><a class="title" href="/" data-v-1168a8e4><!--[--><!--]--><!--[--><img class="VPImage logo" src="/assets/newnewlogo.png" width="24" height="24" alt data-v-8426fc1a><!--]--><span data-v-1168a8e4>Homalos</span><!--[--><!--]--></a></div></div><div class="content" data-v-6aa21345><div class="content-body" data-v-6aa21345><!--[--><!--]--><div class="VPNavBarSearch search" data-v-6aa21345><!--[--><!----><div id="local-search"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><span class="vp-icon DocSearch-Search-Icon"></span><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"><kbd class="DocSearch-Button-Key"></kbd><kbd class="DocSearch-Button-Key">K</kbd></span></button></div><!--]--></div><nav aria-labelledby="main-nav-aria-label" class="VPNavBarMenu menu" data-v-6aa21345 data-v-dc692963><span id="main-nav-aria-label" class="visually-hidden" data-v-dc692963> Main Navigation </span><!--[--><!--[--><a class="VPLink link VPNavBarMenuLink active" href="/guide/quick_start" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>快速开始</span><!--]--></a><!--]--><!--[--><a class="VPLink link VPNavBarMenuLink" href="/other/about" tabindex="0" data-v-dc692963 data-v-e56f3d57><!--[--><span data-v-e56f3d57>关于</span><!--]--></a><!--]--><!--]--></nav><!----><div class="VPNavBarAppearance appearance" data-v-6aa21345 data-v-6c893767><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-6c893767 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div><div class="VPSocialLinks VPNavBarSocialLinks social-links" data-v-6aa21345 data-v-0394ad82 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Homalos/Homalos" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-bd121fe5><span class="vpi-social-github"></span></a><!--]--></div><div class="VPFlyout VPNavBarExtra extra" data-v-6aa21345 data-v-bb2aa2f0 data-v-cf11d7a2><button type="button" class="button" aria-haspopup="true" aria-expanded="false" aria-label="extra navigation" data-v-cf11d7a2><span class="vpi-more-horizontal icon" data-v-cf11d7a2></span></button><div class="menu" data-v-cf11d7a2><div class="VPMenu" data-v-cf11d7a2 data-v-b98bc113><!----><!--[--><!--[--><!----><div class="group" data-v-bb2aa2f0><div class="item appearance" data-v-bb2aa2f0><p class="label" data-v-bb2aa2f0>主题</p><div class="appearance-action" data-v-bb2aa2f0><button class="VPSwitch VPSwitchAppearance" type="button" role="switch" title aria-checked="false" data-v-bb2aa2f0 data-v-5337faa4 data-v-1d5665e3><span class="check" data-v-1d5665e3><span class="icon" data-v-1d5665e3><!--[--><span class="vpi-sun sun" data-v-5337faa4></span><span class="vpi-moon moon" data-v-5337faa4></span><!--]--></span></span></button></div></div></div><div class="group" data-v-bb2aa2f0><div class="item social-links" data-v-bb2aa2f0><div class="VPSocialLinks social-links-list" data-v-bb2aa2f0 data-v-7bc22406><!--[--><a class="VPSocialLink no-icon" href="https://github.com/Homalos/Homalos" aria-label="github" target="_blank" rel="noopener" data-v-7bc22406 data-v-bd121fe5><span class="vpi-social-github"></span></a><!--]--></div></div></div><!--]--><!--]--></div></div></div><!--[--><!--[--><!--[--><div class="VPFlyout VPNolebaseEnhancedReadabilitiesMenu VPNolebaseEnhancedReadabilitiesMenuFlyout" aria-label="阅读增强" role="menuitem" data-v-cf11d7a2><button type="button" class="button" aria-haspopup="true" aria-expanded="false" data-v-cf11d7a2><span class="text" data-v-cf11d7a2><span class="i-icon-park-outline:book-open option-icon" data-v-cf11d7a2></span><!----><span class="vpi-chevron-down text-icon" data-v-cf11d7a2></span></span></button><div class="menu" data-v-cf11d7a2><div class="VPMenu" data-v-cf11d7a2 data-v-b98bc113><!----><!--[--><!--]--></div></div></div><!--]--><!--]--><!--]--><button type="button" class="VPNavBarHamburger hamburger" aria-label="mobile navigation" aria-expanded="false" aria-controls="VPNavScreen" data-v-6aa21345 data-v-e5dd9c1c><span class="container" data-v-e5dd9c1c><span class="top" data-v-e5dd9c1c></span><span class="middle" data-v-e5dd9c1c></span><span class="bottom" data-v-e5dd9c1c></span></span></button></div></div></div></div><div class="divider" data-v-6aa21345><div class="divider-line" data-v-6aa21345></div></div></div><!----></header><div class="VPLocalNav has-sidebar empty" data-v-5d98c3a5 data-v-a6f0e41e><div class="container" data-v-a6f0e41e><button class="menu" aria-expanded="false" aria-controls="VPSidebarNav" data-v-a6f0e41e><span class="vpi-align-left menu-icon" data-v-a6f0e41e></span><span class="menu-text" data-v-a6f0e41e>菜单</span></button><div class="VPLocalNavOutlineDropdown" style="--vp-vh:0px;" data-v-a6f0e41e data-v-8a42e2b4><button data-v-8a42e2b4>回到顶部</button><!----></div></div></div><aside class="VPSidebar" data-v-5d98c3a5 data-v-319d5ca6><div class="curtain" data-v-319d5ca6></div><nav class="nav" id="VPSidebarNav" aria-labelledby="sidebar-aria-label" tabindex="-1" data-v-319d5ca6><span class="visually-hidden" id="sidebar-aria-label" data-v-319d5ca6> Sidebar Navigation </span><!--[--><!--]--><!--[--><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed has-active" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>快速开始</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/quick_start" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>目录导航</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/homalos" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>什么是 Homalos</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/install" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>安装</p><!--]--></a><!----></div><!----></div><section class="VPSidebarItem level-1 collapsible" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h3 class="text" data-v-b3fd67f8>启动</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/start/start_data_center" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>启动数据中心</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/start/start_homalos" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>启动 Homalos</p><!--]--></a><!----></div><!----></div><!--]--></div></section><section class="VPSidebarItem level-1 collapsible has-active" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h3 class="text" data-v-b3fd67f8>配置</h3><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-2 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/config/system_config" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>系统全局配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/config/log_config" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>日志全局配置</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-2 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/guide/config/data_center_config" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>数据中心配置</p><!--]--></a><!----></div><!----></div><!--]--></div></section><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>核心架构</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/core/core" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>核心架构概述</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/core/event_driven_system" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>事件驱动系统</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/core/trading_engine" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>交易引擎</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/core/objects_and_service_registry" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>核心对象和服务注册表</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>网关和外部连接</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/gateway/gateway" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>网关和外部连接概述</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/gateway/ctp_gateway" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>CTP网关</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/gateway/tts_gateway" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>TTS网关</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>数据中心</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/datacenter/datacenter" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>数据中心概述</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>数据服务</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/dataservice/dataservice" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>数据服务概述</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>系统面板</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/dashboard/api" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>请求接口</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><div class="no-transition group" data-v-c40bc020><section class="VPSidebarItem level-0 collapsible collapsed" data-v-c40bc020 data-v-b3fd67f8><div class="item" role="button" tabindex="0" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><h2 class="text" data-v-b3fd67f8>其它</h2><div class="caret" role="button" aria-label="toggle section" tabindex="0" data-v-b3fd67f8><span class="vpi-chevron-right caret-icon" data-v-b3fd67f8></span></div></div><div class="items" data-v-b3fd67f8><!--[--><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/other/community" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>社区资源</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/other/author" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>作者</p><!--]--></a><!----></div><!----></div><div class="VPSidebarItem level-1 is-link" data-v-b3fd67f8 data-v-b3fd67f8><div class="item" data-v-b3fd67f8><div class="indicator" data-v-b3fd67f8></div><a class="VPLink link link" href="/other/about" data-v-b3fd67f8><!--[--><p class="text" data-v-b3fd67f8>联系</p><!--]--></a><!----></div><!----></div><!--]--></div></section></div><!--]--><!--[--><!--]--></nav></aside><div class="VPContent has-sidebar" id="VPContent" data-v-5d98c3a5 data-v-1428d186><div class="VPDoc has-sidebar has-aside" data-v-1428d186 data-v-39a288b8><!--[--><!--]--><div class="container" data-v-39a288b8><div class="aside" data-v-39a288b8><div class="aside-curtain" data-v-39a288b8></div><div class="aside-container" data-v-39a288b8><div class="aside-content" data-v-39a288b8><div class="VPDocAside" data-v-39a288b8 data-v-3f215769><!--[--><!--]--><!--[--><!--]--><nav aria-labelledby="doc-outline-aria-label" class="VPDocAsideOutline" data-v-3f215769 data-v-a5bbad30><div class="content" data-v-a5bbad30><div class="outline-marker" data-v-a5bbad30></div><div aria-level="2" class="outline-title" id="doc-outline-aria-label" role="heading" data-v-a5bbad30>页面导航</div><ul class="VPDocOutlineItem root" data-v-a5bbad30 data-v-b933a997><!--[--><!--]--></ul></div></nav><!--[--><!--]--><div class="spacer" data-v-3f215769></div><!--[--><!--]--><!----><!--[--><!--]--><!--[--><!--]--></div></div></div></div><div class="content" data-v-39a288b8><div class="content-container" data-v-39a288b8><!--[--><!--]--><main class="main" data-v-39a288b8><div style="position:relative;" class="vp-doc _guide_config_system_config" data-v-39a288b8><div><h1 id="homalos系统全局配置说明" tabindex="-1">Homalos系统全局配置说明 <a class="header-anchor" href="#homalos系统全局配置说明" aria-label="Permalink to &quot;Homalos系统全局配置说明&quot;">​</a></h1><div my-4 class="vp-nolebase-page-properties vp-nolebase-page-properties-container"><div class="vp-nolebase-page-properties-grid grid grid-cols-[180px_auto] gap-1 &lt;sm:grid-cols-[120px_auto]"><!--[--><!--[--><div transition="all ease-in-out" flex items-start text="zinc-400 dark:zinc-500 sm &lt;sm:xs" duration-250><div transition="all ease-in-out" min-h="8 &lt;sm:7" px="2 &lt;sm:1" py="2 &lt;sm:1" w-full flex cursor-pointer items-center bg="hover:zinc-100 dark:hover:zinc-800" rounded-md duration-250><div i-icon-park-outline:add-text mr-1></div><span overflow-hidden text-ellipsis whitespace-nowrap>字数</span></div></div><div cursor-pointer transition="all ease-in-out" min-h="8 &lt;sm:7" px="2 &lt;sm:1" py="1.5 &lt;sm:1" flex="~ row wrap" items-center gap-1 rounded-md text="sm &lt;sm:xs" bg="hover:zinc-100 dark:hover:zinc-800" duration-250><div class="vp-nolebase-page-property" data-page-property="value" data-page-property-type="dynamic" data-page-property-dynamic-type="word-count" w-full inline-flex items-center><span>2522 字</span></div></div><!--]--><!--[--><div transition="all ease-in-out" flex items-start text="zinc-400 dark:zinc-500 sm &lt;sm:xs" duration-250><div transition="all ease-in-out" min-h="8 &lt;sm:7" px="2 &lt;sm:1" py="2 &lt;sm:1" w-full flex cursor-pointer items-center bg="hover:zinc-100 dark:hover:zinc-800" rounded-md duration-250><div i-icon-park-outline:timer mr-1></div><span overflow-hidden text-ellipsis whitespace-nowrap>阅读时间</span></div></div><div cursor-pointer transition="all ease-in-out" min-h="8 &lt;sm:7" px="2 &lt;sm:1" py="1.5 &lt;sm:1" flex="~ row wrap" items-center gap-1 rounded-md text="sm &lt;sm:xs" bg="hover:zinc-100 dark:hover:zinc-800" duration-250><div class="vp-nolebase-page-property" data-page-property="value" data-page-property-type="dynamic" data-page-property-dynamic-type="reading-time" w-full inline-flex items-center><span>11 分钟</span></div></div><!--]--><!--]--></div></div><p>Homalos 系统全局配置文件位于系统根目录下 <code>src\config\</code> 中，将名为 <strong>system.yaml.example</strong> 的模板文件名称修改为 <strong>system.yaml</strong>，即可启用配置。</p><h2 id="_1-基础配置" tabindex="-1">1. 基础配置 <a class="header-anchor" href="#_1-基础配置" aria-label="Permalink to &quot;1. 基础配置&quot;">​</a></h2><p>本系统的基础配置，一般情况下保持默认值即可，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">system</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Homalos&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                  # 系统名称</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  describe</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Homalos Quantitative Trading System&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 系统描述信息</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;0.0.1&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                 # 系统版本号</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  data_path</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;data/&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                               # 数据存储路径</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  timezone</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Asia/Shanghai&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                        # 系统时区</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 测试模式配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  test_mode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                 # 是否启用测试模式</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  test_trading_hours</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                         # 测试模式下是否绕过交易时间检查</span></span></code></pre></div><h2 id="_2-事件总线配置" tabindex="-1">2. 事件总线配置 <a class="header-anchor" href="#_2-事件总线配置" aria-label="Permalink to &quot;2. 事件总线配置&quot;">​</a></h2><p>对本系统的事件总线进行精确控制，一般情况下保持默认值即可，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">event_bus</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;event_bus&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">            # 事件总线名称</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  max_async_queue_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 异步队列最大长度</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  max_sync_queue_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 同步队列最大长度</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  timer_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.0</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">          # 定时器间隔时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_monitoring</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 是否启用监控</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_priority</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 是否启用优先级队列</span></span></code></pre></div><h2 id="_3-数据库配置" tabindex="-1">3. 数据库配置 <a class="header-anchor" href="#_3-数据库配置" aria-label="Permalink to &quot;3. 数据库配置&quot;">​</a></h2><p>订单、成交、账户更新等数据存储到数据库的配置，默认支持 sqlite 数据存储，未来可根据情况扩展。</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">database</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  type</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;sqlite&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">             # 数据库类型</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  path</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;data/&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">              # 数据库文件存储路径</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  batch_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">            # 批量插入大小</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  flush_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">          # 刷新间隔时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  connection_pool_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 连接池大小</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_wal</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 启用WAL模式提高并发性能</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  timezone</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;Asia/Shanghai&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 数据库时区</span></span></code></pre></div><h2 id="_4-行情和交易服务器节点配置" tabindex="-1">4. 行情和交易服务器节点配置 <a class="header-anchor" href="#_4-行情和交易服务器节点配置" aria-label="Permalink to &quot;4. 行情和交易服务器节点配置&quot;">​</a></h2><p>行情和交易服务器节点配置是本系统底层连接的服务器节点，系统的行情源和订单发送就是通过服务器节点最终到达交易所。修改服务器节点中对应的参数 <strong>enabled</strong> 值为 <strong>true</strong>，并填入正确的账户信息就可以启用，例如：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">gateway</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enabled_broker</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;simnow&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                           # 默认使用的行情和交易服务器节点配置名称</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  brokers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:                                           </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 行情和交易服务器节点配置列表</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    simnow</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:                                          </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># simnow 服务器节点前置配置(行情和实盘交易一致)</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      broker_id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;9999&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                              # 经纪商ID</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      md_address</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;tcp://182.254.243.31:30011&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 行情服务器地址和端口</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      td_address</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;tcp://182.254.243.31:30001&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 交易服务器地址和端口</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      app_id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;simnow_client_test&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                   # 应用ID</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      auth_code</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;0000000000000000&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                  # 授权码</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      user_id</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                    # 用户ID</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      password</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                   # 密码</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      product_info</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                               # 产品信息</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      md_timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                 # 行情服务器超时时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      td_timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                                 # 交易服务器超时时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      reconnect_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                          # 重连间隔时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_reconnect_attempts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                     # 最大重连次数</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">      ...</span></span></code></pre></div><details class="details custom-block"><summary>关于服务器节点</summary><p>模板中的默认配置均为 simnow 或 tts 模拟服务器环境，它们是为了方便程序化交易者，在未接入实盘之前进行测试，simnow 和 tts 环境都提供了完整的模拟行情和交易的流程。当要接入实盘时，需要自行增加配置期货公司提供的实盘服务器节点及账户信息。了解更多服务器节点信息请加入我们的社群。</p></details><h2 id="_5-风控配置" tabindex="-1">5. 风控配置 <a class="header-anchor" href="#_5-风控配置" aria-label="Permalink to &quot;5. 风控配置&quot;">​</a></h2><p>风控配置是对交易风险的控制，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">risk</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                   # 启用风控</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  max_position_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 最大持仓金额（元）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  max_daily_loss</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">50000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 单日最大亏损（元）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  max_order_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">             # 单笔最大手数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  order_frequency_limit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 每秒最大订单数 (从10增加到100)</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  position_concentration</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.5</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">     # 单品种最大仓位比例 (从0.3放宽到0.5)</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_self_trade_check</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 启用自成交检查 (测试环境关闭)</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_price_check</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 启用价格合理性检查</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  price_deviation_threshold</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.1</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 价格偏离阈值 (从5%放宽到10%)</span></span></code></pre></div><h2 id="_6-策略管理配置" tabindex="-1">6. 策略管理配置 <a class="header-anchor" href="#_6-策略管理配置" aria-label="Permalink to &quot;6. 策略管理配置&quot;">​</a></h2><p>策略管理的配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 策略管理配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">strategy</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  base_path</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;src/strategies/&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 策略代码基础路径</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  auto_start</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">              # 启动时自动加载策略</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  max_concurrent_strategies</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 最大并发策略数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_hot_reload</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 启用热重载</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  default_params</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:                </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 默认策略参数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    initial_capital</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 初始资金（元）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    max_drawdown</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.1</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">            # 最大回撤比例</span></span></code></pre></div><h2 id="_7-策略增强管理配置" tabindex="-1">7. 策略增强管理配置 <a class="header-anchor" href="#_7-策略增强管理配置" aria-label="Permalink to &quot;7. 策略增强管理配置&quot;">​</a></h2><p>策略增强管理配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">strategy_management</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 依赖检查配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  dependency_check</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">               # 启用依赖检查</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    cache_ttl</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">300</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">              # 缓存时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                 # 检查超时时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    retry_attempts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 重试次数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    checks</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:                     </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 检查项</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      gateway_connection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 网关连接状态</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      contract_info</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 合约信息状态</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      account_balance</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">     # 账户余额状态</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      market_hours</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 交易时间状态</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      risk_limits</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # 风控限制状态</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      data_feed</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 数据源状态</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">  </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 策略验证配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  strategy_validation</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                 # 启用策略验证</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    cache_ttl</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">600</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                # 缓存时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    timeout</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                   # 验证超时时间（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    validations</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:                  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 验证项</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      syntax_check</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">          # 语法检查</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      required_methods</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 必需方法检查</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      parameter_validation</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 参数验证</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      risk_rules</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">            # 风控规则验证</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      compatibility_check</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 兼容性检查</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 代码复杂度限制</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    complexity_limits</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_cyclomatic_complexity</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 最大圈复杂度</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_method_lines</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">          # 最大方法行数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_class_methods</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">          # 最大类方法数</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">  </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 健康监控配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  health_monitoring</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">             # 启用健康监控</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    check_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 健康检查间隔（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    metrics_window</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">300</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 指标统计窗口（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    auto_recovery</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 启用自动恢复</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    max_recovery_attempts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 最大恢复尝试次数</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 健康阈值</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    thresholds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_error_rate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.05</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 最大错误率（5%）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_latency_ms</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 最大延迟（毫秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      min_success_rate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.95</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">     # 最小成功率（95%）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_memory_usage_mb</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">500</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 最大内存使用（MB）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_cpu_usage_percent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">80</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 最大CPU使用率（%）</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 异常检测配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    anomaly_detection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">     # 启用异常检测</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      sensitivity</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.8</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 敏感度（0-1）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      min_samples</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 最小样本数</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">  </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 事件处理配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  event_handling</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 启用事件处理</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    persistence</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 启用持久化</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    database_path</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;data/strategy_events.db&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 数据库路径</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 事件过滤配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    filters</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      min_priority</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;INFO&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 最小事件优先级</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_age_hours</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">168</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 事件最大保存时间（小时，7天）</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 事件聚合配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    aggregation</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 启用事件聚合</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      window_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">60</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # 聚合窗口（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      max_events</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 最大事件数</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 定时任务配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    scheduled_tasks</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      flush_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 刷新到数据库间隔（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">      cleanup_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3600</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 清理旧事件间隔（秒）</span></span></code></pre></div><h2 id="_8-数据服务配置" tabindex="-1">8. 数据服务配置 <a class="header-anchor" href="#_8-数据服务配置" aria-label="Permalink to &quot;8. 数据服务配置&quot;">​</a></h2><p>数据服务配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">data</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 行情数据</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  market</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enable_data_center</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 是否启用数据中心</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    buffer_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # 行情数据缓冲区大小</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enable_persistence</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 启用行情数据持久化</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    tick_storage_days</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">     # 行情数据保存天数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    bar_storage_days</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">365</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">     # 历史数据保存天数</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 历史数据</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  history</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    provider</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;local&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # local, tushare, akshare</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    cache_size</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">          # 历史数据缓存大小</span></span></code></pre></div><h2 id="_9-web管理界面配置" tabindex="-1">9. Web管理界面配置 <a class="header-anchor" href="#_9-web管理界面配置" aria-label="Permalink to &quot;9. Web管理界面配置&quot;">​</a></h2><p>Web管理界面配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">web</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 启用Web管理界面</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  host</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;127.0.0.1&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 监听地址</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  port</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">8000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 监听端口</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  debug</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # 启用调试模式</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  cors_origins</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;*&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 允许跨域的源</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  cors_methods</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;GET&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;POST&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;PUT&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;DELETE&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 允许的跨域方法</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  cors_headers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;*&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]         </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 允许的跨域头部</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  static_files</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;web/static&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 静态文件目录</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  templates</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;web/templates&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 模板文件目录</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">  </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # WebSocket配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  websocket</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    heartbeat_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">30</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 心跳间隔（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    max_connections</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 最大连接数</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # API配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  api</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    rate_limit</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # 每分钟最大请求数</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enable_swagger</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 启用Swagger文档</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    api_prefix</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;/api/v1&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # API前缀</span></span></code></pre></div><h2 id="_10-性能监控配置" tabindex="-1">10. 性能监控配置 <a class="header-anchor" href="#_10-性能监控配置" aria-label="Permalink to &quot;10. 性能监控配置&quot;">​</a></h2><p>性能监控配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">monitoring</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">         # 启用性能监控</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  metrics_interval</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 统计间隔（秒）</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_alerts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 启用告警</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">  </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 性能阈值</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  thresholds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    order_latency_ms</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # 订单延迟阈值（毫秒），调整为100ms适应测试环境</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    tick_processing_rate</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 行情处理速率阈值（每秒），调整为1000适应测试环境</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    memory_usage_mb</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">32000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 内存使用阈值（MB），调整为32GB适应开发环境</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    cpu_usage_percent</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">95</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # CPU使用率阈值（%），调整为95%适应开发环境</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">    </span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 告警配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  alerts</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    high_latency_threshold</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">200</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 高延迟阈值（毫秒），调整为200ms适应测试环境</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    memory_threshold</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">32000</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">      # 内存使用阈值（MB），调整为32GB适应开发环境</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    error_rate_threshold</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.1</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">    # 错误率阈值（%），调整为10%适应测试环境</span></span></code></pre></div><h2 id="_11-交易时段配置" tabindex="-1">11. 交易时段配置 <a class="header-anchor" href="#_11-交易时段配置" aria-label="Permalink to &quot;11. 交易时段配置&quot;">​</a></h2><p>交易时段配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">trading_hours</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enable_check</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 启用交易时段检查</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  sessions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    futures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:                </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 期货交易时段配置，格式为[[&quot;开始时间&quot;, &quot;结束时间&quot;], ...]</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;09:00&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;10:15&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 早盘</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;10:30&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;11:30&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 早盘</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;13:30&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;15:00&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 午盘</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;21:00&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;02:30&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 夜盘(某些品种)</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">      - [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;21:00&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;23:00&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]  </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 夜盘(大部分品种)</span></span></code></pre></div><h2 id="_12-邮箱配置-可选" tabindex="-1">12. 邮箱配置（可选） <a class="header-anchor" href="#_12-邮箱配置-可选" aria-label="Permalink to &quot;12. 邮箱配置（可选）&quot;">​</a></h2><p>邮箱配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">email</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">              # 启用邮件通知</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  smtp_server</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">             # SMTP服务器地址</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  smtp_port</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">465</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">              # SMTP端口号</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  username</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                # 邮件发送者用户名</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  password</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                # 邮件发送者密码</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  sender</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">                  # 邮件发送者邮箱地址</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  receivers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: []               </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># 邮件接收者邮箱地址列表</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 邮件触发条件</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  triggers</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    system_error</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">        # 系统错误</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    high_loss</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">           # 重大亏损</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    strategy_stopped</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">   # 策略停止</span></span></code></pre></div><h2 id="_13-外部数据源配置-可选" tabindex="-1">13. 外部数据源配置（可选） <a class="header-anchor" href="#_13-外部数据源配置-可选" aria-label="Permalink to &quot;13. 外部数据源配置（可选）&quot;">​</a></h2><p>外部数据源配置，可自行修改为合适的参数值，具体参数说明如下：</p><div class="language-yaml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">yaml</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0"><code><span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">external_data</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  tushare</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:          </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Tushare配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 启用Tushare</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    token</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;&quot;</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">       # Tushare Token</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">  akshare</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:          </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># AkShare配置</span></span>
<span class="line"><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">    enabled</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">  # 启用AkShare</span></span></code></pre></div><!--[--><!----><div class="bg-green/16 mt-6 vp-nolebase-git-changelog vp-nolebase-git-changelog-history vp-nolebase-git-changelog-history-list vp-nolebase-git-changelog-history-container" rounded-lg p-4 data-v-9cc63e9c><label cursor-pointer data-v-9cc63e9c><div class="vp-nolebase-git-changelog-title flex select-none items-center justify-between" transition="color ease-in-out" text="&lt;sm:xs" duration-200 data-v-9cc63e9c><span class="vp-nolebase-git-changelog-last-edited-title inline-flex items-center gap-3" data-v-9cc63e9c><div class="i-octicon:history-16" data-v-9cc63e9c></div><span data-v-9cc63e9c>最后编辑于 15 分钟前</span></span><div class="i-octicon:sort-desc-16" ml-auto mr-4 cursor-pointer data-v-9cc63e9c></div><span class="vp-nolebase-git-changelog-view-full-history-title inline-flex cursor-pointer items-center gap-3" data-v-9cc63e9c><span class="&lt;sm:hidden" data-v-9cc63e9c>查看完整历史</span><svg class="rotate-0 i-octicon:chevron-down-16" transition="transform ease-in-out" duration-200 data-v-9cc63e9c></svg></span></div></label><div style="display:none;" class="grid grid-cols-[30px_auto] mt-3 gap-1.5 children:my-auto -ml-1.5" text="&lt;sm:xs" data-v-9cc63e9c><!--[--><!--[--><!--[--><div class="i-octicon:git-commit-16 m-auto rotate-90 transform op-30" data-v-0e4a2b5f></div><div flex gap-1 align-baseline data-v-0e4a2b5f><a href="https://github.com/Homalos/HomalosDocs/commit/1f3d31e4b9f040a2cce81918cf7a3d5e795d83d4" target="_blank" class="no-icon" data-v-0e4a2b5f><code class="text-xs text-$vp-c-brand-1 hover:text-$vp-c-brand-1" transition="color ease-in-out" duration-200 data-v-0e4a2b5f>1f3d31e</code></a><span data-v-0e4a2b5f>-</span><span data-v-0e4a2b5f><span class="text-sm &lt;sm:text-xs" data-v-0e4a2b5f>Update config markdown file</span><span class="my-1 ml-3 gap-1" data-v-0e4a2b5f><!--[--><!--[--><img src="https://gravatar.com/avatar/b8d5677fa18909432d3b381a59fa6cbe31323f9c976d2c30c3d3c57032d01194?d=retro" alt="The avatar of contributor named as Donny" class="vp-nolebase-git-changelog-commit-avatar inline-block h-6 w-6 rounded-full v-middle" data-v-0e4a2b5f><!--]--><!--]--></span><!----></span></div><!--]--><!--]--><!--[--><!--[--><div class="i-octicon:git-commit-16 m-auto rotate-90 transform op-30" data-v-0e4a2b5f></div><div flex gap-1 align-baseline data-v-0e4a2b5f><a href="https://github.com/Homalos/HomalosDocs/commit/2c6af9f9d87e4b772555c44805c7e9e20e00b87f" target="_blank" class="no-icon" data-v-0e4a2b5f><code class="text-xs text-$vp-c-brand-1 hover:text-$vp-c-brand-1" transition="color ease-in-out" duration-200 data-v-0e4a2b5f>2c6af9f</code></a><span data-v-0e4a2b5f>-</span><span data-v-0e4a2b5f><span class="text-sm &lt;sm:text-xs" data-v-0e4a2b5f>更新快速开始和日志配置文档，调整侧边栏内容，增加数据中心和数据服务概述</span><span class="my-1 ml-3 gap-1" data-v-0e4a2b5f><!--[--><!--[--><img src="https://gravatar.com/avatar/b8d5677fa18909432d3b381a59fa6cbe31323f9c976d2c30c3d3c57032d01194?d=retro" alt="The avatar of contributor named as Donny" class="vp-nolebase-git-changelog-commit-avatar inline-block h-6 w-6 rounded-full v-middle" data-v-0e4a2b5f><!--]--><!--]--></span><!----></span></div><!--]--><!--]--><!--[--><!--[--><div class="i-octicon:git-commit-16 m-auto rotate-90 transform op-30" data-v-0e4a2b5f></div><div flex gap-1 align-baseline data-v-0e4a2b5f><a href="https://github.com/Homalos/HomalosDocs/commit/4384d966ea490bb4a72873dc5ec825566566b7a9" target="_blank" class="no-icon" data-v-0e4a2b5f><code class="text-xs text-$vp-c-brand-1 hover:text-$vp-c-brand-1" transition="color ease-in-out" duration-200 data-v-0e4a2b5f>4384d96</code></a><span data-v-0e4a2b5f>-</span><span data-v-0e4a2b5f><span class="text-sm &lt;sm:text-xs" data-v-0e4a2b5f>Update zh.ts、footerDta.ts and markdown files</span><span class="my-1 ml-3 gap-1" data-v-0e4a2b5f><!--[--><!--[--><img src="https://gravatar.com/avatar/b8d5677fa18909432d3b381a59fa6cbe31323f9c976d2c30c3d3c57032d01194?d=retro" alt="The avatar of contributor named as Donny" class="vp-nolebase-git-changelog-commit-avatar inline-block h-6 w-6 rounded-full v-middle" data-v-0e4a2b5f><!--]--><!--]--></span><!----></span></div><!--]--><!--]--><!--[--><!--[--><div class="i-octicon:git-commit-16 m-auto rotate-90 transform op-30" data-v-0e4a2b5f></div><div flex gap-1 align-baseline data-v-0e4a2b5f><a href="https://github.com/Homalos/HomalosDocs/commit/4dc8588b542543fa56f87c19ce55218cfb1b410e" target="_blank" class="no-icon" data-v-0e4a2b5f><code class="text-xs text-$vp-c-brand-1 hover:text-$vp-c-brand-1" transition="color ease-in-out" duration-200 data-v-0e4a2b5f>4dc8588</code></a><span data-v-0e4a2b5f>-</span><span data-v-0e4a2b5f><span class="text-sm &lt;sm:text-xs" data-v-0e4a2b5f>Add md</span><span class="my-1 ml-3 gap-1" data-v-0e4a2b5f><!--[--><!--[--><img src="https://gravatar.com/avatar/b8d5677fa18909432d3b381a59fa6cbe31323f9c976d2c30c3d3c57032d01194?d=retro" alt="The avatar of contributor named as Donny" class="vp-nolebase-git-changelog-commit-avatar inline-block h-6 w-6 rounded-full v-middle" data-v-0e4a2b5f><!--]--><!--]--></span><!----></span></div><!--]--><!--]--><!--[--><!--[--><div class="i-octicon:git-commit-16 m-auto rotate-90 transform op-30" data-v-0e4a2b5f></div><div flex gap-1 align-baseline data-v-0e4a2b5f><a href="https://github.com/Homalos/HomalosDocs/commit/e28d794c41309af1f68c66c980f2042e63bb6290" target="_blank" class="no-icon" data-v-0e4a2b5f><code class="text-xs text-$vp-c-brand-1 hover:text-$vp-c-brand-1" transition="color ease-in-out" duration-200 data-v-0e4a2b5f>e28d794</code></a><span data-v-0e4a2b5f>-</span><span data-v-0e4a2b5f><span class="text-sm &lt;sm:text-xs" data-v-0e4a2b5f>First commit.</span><span class="my-1 ml-3 gap-1" data-v-0e4a2b5f><!--[--><!--[--><img src="https://gravatar.com/avatar/b8d5677fa18909432d3b381a59fa6cbe31323f9c976d2c30c3d3c57032d01194?d=retro" alt="The avatar of contributor named as Donny" class="vp-nolebase-git-changelog-commit-avatar inline-block h-6 w-6 rounded-full v-middle" data-v-0e4a2b5f><!--]--><!--]--></span><!----></span></div><!--]--><!--]--><!--]--></div></div><!--]--></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><div class="edit-link" data-v-e257564d><a class="VPLink link vp-external-link-icon no-icon edit-link-button" href="https://github.com/Homalos/HomalosDocs/edit/main/src/guide/config/system_config.md" target="_blank" rel="noreferrer" data-v-e257564d><!--[--><span class="vpi-square-pen edit-link-icon" data-v-e257564d></span> 在 GitHub 上编辑此页面<!--]--></a></div><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2025-07-31T14:47:48.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/guide/start/start_homalos" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>上一页</span><span class="title" data-v-e257564d>启动 Homalos</span><!--]--></a></div><div class="pager" data-v-e257564d><a class="VPLink link pager-link next" href="/guide/config/log_config" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>下一页</span><span class="title" data-v-e257564d>日志全局配置</span><!--]--></a></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!----><!--]--></div></div>
    
    
  </body>
</html>